/* eslint-disable @typescript-eslint/no-explicit-any */
/*
 *  Copyright 2021 Collate
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

 /**
 * 此模式定义Page实体，Page是在OpenMetadata中用于定制的着陆页，模式页面
 */
export interface Page {
    /**
     * 此页面所属的域
     */
    domain?: EntityReference;
    /**
     * 实体类型
     */
    entityType: EntityType;
    /**
     * 属于此页面的KnowledgePanels
     */
    knowledgePanels: EntityReference[];
    /**
     * Knowledge Panel的配置
     */
    layout:   { [key: string]: any };
    pageType: PageType;
    /**
     * 此页面所属的角色
     */
    persona?: EntityReference;
}

/**
 * 此页面所属的域
 *
 * This schema defines the EntityReference type used for referencing an entity.
 * EntityReference is used for capturing relationships from one entity to another. For
 * example, a table has an attribute called database of type EntityReference that captures
 * the relationship of a table `belongs to a` database.
 *
 * 属于此页面的KnowledgePanels
 *
 *
 * 此模式定义了用于引用实体的EntityReferenceList类型，EntityReference用于捕获从一个实体到另一个实体的关系。例如，表具有一个名为数据库的EntityReference类型的属性，该属性捕获表“属于”数据库的关系。
 *
 * 此页面所属的角色
 */
export interface EntityReference {
    /**
     * If true the entity referred to has been soft-deleted.
     */
    deleted?: boolean;
    /**
     * Optional description of entity.
     */
    description?: string;
    /**
     * Display Name that identifies this entity.
     */
    displayName?: string;
    /**
     * Fully qualified name of the entity instance. For entities such as tables, databases
     * fullyQualifiedName is returned in this field. For entities that don't have name hierarchy
     * such as `user` and `team` this will be same as the `name` field.
     */
    fullyQualifiedName?: string;
    /**
     * Link to the entity resource.
     */
    href?: string;
    /**
     * Unique identifier that identifies an entity instance.
     */
    id: string;
    /**
     * If true the relationship indicated by this entity reference is inherited from the parent
     * entity.
     */
    inherited?: boolean;
    /**
     * Name of the entity instance.
     */
    name?: string;
    /**
     * Entity type/class name - Examples: `database`, `table`, `metrics`, `databaseService`,
     * `dashboardService`...
     */
    type: string;
}

/**
 * 实体类型
 */
export enum EntityType {
    Page = "Page",
}

/**
 * 此模式定义用于描述不同类型页面的类型
 */
export enum PageType {
    ContainerLandingPage = "ContainerLandingPage",
    DashboardDataModelLandingPage = "DashboardDataModelLandingPage",
    DashboardLandingPage = "DashboardLandingPage",
    DatabaseLandingPage = "DatabaseLandingPage",
    DatabaseSchemaLandingPage = "DatabaseSchemaLandingPage",
    DomainLandingPage = "DomainLandingPage",
    GlossaryLandingPage = "GlossaryLandingPage",
    GlossaryTermLandingPage = "GlossaryTermLandingPage",
    LandingPage = "LandingPage",
    PipelineLandingPage = "PipelineLandingPage",
    SearchIndexLandingPage = "SearchIndexLandingPage",
    StoredProcedureLandingPage = "StoredProcedureLandingPage",
    TableLandingPage = "TableLandingPage",
    TopicLandingPage = "TopicLandingPage",
}
